/**
 * config
 * Email: thedanyang@qq.com
 * Date: 2024-02-02 18:04:22
 * Author: deary
 * Copyright (c) 2021 AYY
 */

import { defineStore } from "pinia";
import { APP_BASE_API } from "@/config.js";

let wHeight = 667;
let wWidth = 375;

try {
  const res = uni.getSystemInfoSync();

  wHeight = res.windowHeight;
  wWidth = res.windowWidth;
} catch (e) {
  console.error(e);
}

export const useConfigStore = defineStore("config", {
  state: () => {
    return {
      prefix: "https://view.officeapps.live.com/op/view.aspx?src=",
      imagePrefix: APP_BASE_API,
      wHeight: wHeight,
      wWidth: wWidth
    };
  },
  actions: {}
});
